Upgrade from Web3Modal to Reown AppKit for React Native
This document outlines the steps to migrate from the old @web3modal packages to the new @reown/appkit packages in your React Native project.
Step 1. Replace the dependencies in your code and package.json
Copy
{ "dependencies": { // Remove the following code lines "@web3modal/wagmi-react-native": "2.0.4", "@web3modal/email-wagmi-react-native": "2.0.4", "@web3modal/coinbase-wagmi-react-native": "2.0.4", "@web3modal/siwe-react-native": "2.0.4", // Add the following code lines "@reown/appkit-wagmi-react-native": "1.0.0", "@reown/appkit-auth-wagmi-react-native": "1.0.0", "@reown/appkit-coinbase-wagmi-react-native": "1.0.0", "@reown/appkit-siwe-react-native": "1.0.0" }}
Run yarn install after replacing the packages
Step 2. Update your AppKit config
Copy
// Remove the following code linesimport { createWeb3Modal } from "@web3modal/wagmi-react-native";// Add the following code linesimport { createAppKit } from "@reown/appkit-wagmi-react-native";
Step 3. Update your Hooks usage
Update your hook imports as follows:
Copy
// Remove the following code linesimport { useWeb3Modal, useWeb3ModalState, useWeb3ModalEvents, useWalletInfo,} from "@web3modal/wagmi-react-native";// Add the following code linesimport { useAppKit, useAppKitState, useAppKitEvents, useWalletInfo,} from "@reown/appkit-wagmi-react-native";
Step 4. Update your Components usage
Update your component imports as follows:
Copy
// Remove the following code linesimport { W3mAccountButton, W3mButton, W3mConnectButton, W3mNetworkButton, Web3Modal,} from "@web3modal/wagmi-react-native";// Add the following code linesimport { AccountButton, AppKitButton, ConnectButton, NetworkButton, AppKit,} from "@reown/appkit-wagmi-react-native";
Step 5. Update your config for Universal Wallets
Update email wallet specific imports as follows:
Copy
// Remove the following code linesimport { emailConnector } from "@web3modal/email-wagmi-react-native";// Add the following code linesimport { authConnector } from "@reown/appkit-auth-wagmi-react-native";
Step 6. Update your import to support Coinbase Wallet
Update coinbase connector import as follows:
Copy
// Remove the following code linesimport { coinbaseConnector } from "@web3modal/coinbase-wagmi-react-native";// Add the following code linesimport { coinbaseConnector } from "@reown/appkit-coinbase-wagmi-react-native";